package com.jlastu.dlxy_androidapp.entity;

import java.util.ArrayList;
import java.util.List;

public class Order {
    private String orderId;
    private List<OrderItem> items;
    private double totalAmount;

    public Order(String orderId) {
        this.orderId = orderId;
        this.items = new ArrayList<>();
    }

    // 添加订单项
    public void addItem(OrderItem item) {
        items.add(item);
        totalAmount += item.getItemTotal();
    }

    // 计算订单总金额
    public double calculateTotal() {
        totalAmount = 0;
        for (OrderItem item : items) {
            totalAmount += item.getItemTotal();
        }
        return totalAmount;
    }

    public int getOrderSummary() {
        return 0;
    }
}
